package com.ymatou.search;

import java.util.HashSet;
import java.util.List;

import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;
import com.ymatou.util.Random;

@SuppressWarnings("deprecation")
public class SearchLatelyWordsTest extends UiAutomatorTestCase{
	
	//private static final String TAG = SearchLatelyWordsTest.class.getSimpleName();
		private List<UiObject> objectList;
		
		public SearchLatelyWordsTest(List<UiObject> objectList) {
			this.objectList = objectList;
		}
		
		public void testClickLatelywords() throws UiObjectNotFoundException {
			
			//随机取一个最近搜索词并点击
			HashSet<Integer> set = new HashSet<Integer> ();
			
			Random.randomSet(0, objectList.size(), 1, set);
			
			for (int j : set) {  
	    		UiObject o = objectList.get(j);
	        	o.click();
	    	};
		}
}
